//
//  CustomSlider.m
//  cheshi
//
//  Created by CKF on 2025/8/13.
//  Copyright © 2025 Mac. All rights reserved.
//

#import "CustomSlider.h"

@implementation CustomSlider

- (CGRect)trackRectForBounds:(CGRect)bounds {
    // 1. 获取默认轨道矩形
    CGRect defaultRect = [super trackRectForBounds:bounds];
    
    // 2. 修改高度（若未设置则用默认值）
    CGFloat height = _trackHeight > 0 ? _trackHeight : 3.0;
    return CGRectMake(
        defaultRect.origin.x,
        defaultRect.origin.y + (defaultRect.size.height - height) / 2, // 垂直居中
        defaultRect.size.width,
        height
    );
}

@end
